﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MaterialStorage.Model
{
    /// <summary>
    /// 出入库记录
    /// </summary>
    public class QuantityRecoder
    {
        /// <summary>
        /// 编号
        /// </summary>
        public int Id { get; set; }
        /// <summary>
        /// 材料编号
        /// </summary>
        public int MaterialId { get; set; }
        /// <summary>
        /// 相关材料
        /// </summary>
        public virtual Material Material { get; set; }
        /// <summary>
        /// 出入库方向 0 出 1 入
        /// </summary>
        public int Direction { get; set; }
        /// <summary>
        /// 出入库数量
        /// </summary>
        public double Quantity { get; set; }
        /// <summary>
        /// 剩余数量
        /// </summary>
        public int SurplusQuantity { get; set; }
        /// <summary>
        /// 操作时间
        /// </summary>
        public DateTime Pdate { get; set; }
        /// <summary>
        /// 领料人编号
        /// </summary>
        public int PickerId { get; set; }
        /// <summary>
        /// 领料人
        /// </summary>
        public virtual Picker Picker { get; set; }
        /// <summary>
        /// 相关描述
        /// </summary>
        public string Desp { get; set; }

        public QuantityRecoder()
        {
            this.Direction = int.MinValue;
            this.Id = int.MinValue;
            this.MaterialId = int.MinValue;
            this.PickerId = int.MinValue;
            this.Quantity = int.MinValue;
            this.Pdate = DateTime.MinValue;
            this.SurplusQuantity = int.MinValue;
        }

        public List<dynamic> GetList(DavidDB.ADO.DBManager db)
        {
            var query = db.GetList(new QuantityRecoder()).ToList();
            return query;
        }
    }
}
